package com.example.customconsume.component;

import com.example.customconsume.component.chain.HandlerChain;
import com.example.customconsume.entity.ConsumeDto;
import com.example.customconsume.service.ChangeWalletContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Description 普通支付
 * @Author lihw
 * @Date 2024/7/10 16:41
 */
@Order(5)
@Component
@Slf4j
public class DefaultCustomPayHandler implements CustomPayHandler<ConsumeDto> {

    private final ChangeWalletContext changeWalletContext;

    public DefaultCustomPayHandler(ChangeWalletContext changeWalletContext) {
        this.changeWalletContext = changeWalletContext;
    }

    @Override
    public ConsumeDto handleCustomPay(ConsumeDto consumeDto, HandlerChain handlerChain) {
        log.info("生成订单");
        log.info("生成订单明细");
        log.info("改变钱包余额");
        log.info("生成流水");
        log.info("更新订单状态");
        log.info("更新订单明细状态");

        return consumeDto;
    }
}
